<?php
namespace Menu\Controller;
use Think\Controller;
class PhotoController extends LoginController {
	protected $DB;
	public function __construct(){
		parent::__construct();
		$this->DB = D('Photos');
	}

	public function photoAdd(){
		$data = $this->DB->PhotoAdd();
		if($data['number']){
			$this->success($data['info']);
		}else{
			$this->error('照片添加失败');
		}
	}

	public function photosSel($album_id){
		layout(false);
		$dataList = $this->DB->photoList($album_id);
		$this->assign('List',$dataList);
		$this->assign('first',$dataList[0]['photo_url']);
		$this->assign('title',$dataList[0]['album_name']);
		$this->display();
	}
}